#!/usr/bin/env python

from kivy.uix.tabbedpanel import TabbedPanel, TabbedPanelHeader

from amgineirc.view.settings.serversView import ServersView
from amgineirc.view.settings.rulesView import RulesView
from amgineirc.view.settings.trustedView import TrustedView

class SettingsView(TabbedPanel):
    """a view for all of the settings pages

    this view has no view model
    its pages have their own view models
    """
    def __init__(self, appdata, **kargs):
        kargs['do_default_tab'] = False
        TabbedPanel.__init__(self, **kargs)
        # add the server settings tab
        th = TabbedPanelHeader(text='IRC Servers')
        th.content = ServersView(appdata,
                                 size_hint=(1.0, 1.0))
        self.add_widget(th)
        # add the rules settings tab
        th = TabbedPanelHeader(text='Rotary Encryption Rules')
        th.content = RulesView(appdata,
                               size_hint=(1.0, 1.0))
        self.add_widget(th)
        # add the trusted users view
        th = TabbedPanelHeader(text='Trusted Nicks')
        th.content = TrustedView(appdata,
                               size_hint=(1.0, 1.0))
        self.add_widget(th)

